home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 52 / Amiga Format AFCD52 (Issue 136, May 2000).iso / -serious- / programming / other / whdload / rawdic17.lha / Examples / OutRun.islave.asm < prev    next >
Assembly Source File  |  1999-03-20  |  3KB  |  112 lines

  1.  
  2.  
  3.     ; OutRun imager
  4.  
  5.  
  6.     ; 1987 OutRun disk format:
  7.  
  8.     ; The disk is in a standard Amiga 11-sector format where all
  9.     ; sectors (except for the ones on track 0) have changed blockheaders
  10.     ; so Amiga DOS cannot read these.
  11.  
  12.     ; The track layout is different to other formats:
  13.  
  14.     ; The disk is double sided, but track 0 to 79 are on cylinder
  15.     ; 0 to 79 on side 0, track 80 to 159 are on cylinder 0 to 79 on
  16.     ; side 1.
  17.  
  18.     ; Tracks 43 to 45 are not formatted.
  19.  
  20.  
  21.     ; 1988 OutRun disk format:
  22.  
  23.     ; Tracks 0 to 1 and 76 to 89 are in Amiga format, the disk
  24.     ; contains a standard bootblock and two files on disk:
  25.  
  26.     ; S/STARTUP-SEQUENCE    (only contains "BOOT" as string)
  27.     ; BOOT            (contains the bootloader with loaderscreen)
  28.  
  29.     ; All other tracks are in "Hackmatt" format.
  30.  
  31.     ; Explanation of a "Hackmatt"-track:
  32.  
  33.     ; Sync ($4489)
  34.     ; $55555555,$AAAAAAAA
  35.     ; 1 longword checksum
  36.     ; $5DC longwords data ($1770 bytes)
  37.  
  38.     ; The MFM decoding is very simple, just a standard DECODE_L
  39.     ; for every longword.
  40.  
  41.  
  42.         incdir    Includes:
  43.         include    RawDIC.i
  44.  
  45.         SLAVE_HEADER
  46.         dc.b    1    ; Slave version
  47.         dc.b    0    ; Slave flags
  48.         dc.l    DSK_1a    ; Pointer to the first disk structure
  49.         dc.l    Text    ; Pointer to the text displayed in the imager window
  50.  
  51.         dc.b    "$VER:"
  52. Text:        dc.b    "Outrun imager V1.1",10,"by John Selck on 21.03.1999",0
  53.         cnop    0,4
  54.  
  55. DSK_1a:        dc.l    0        ; pointer to next disk structure
  56.         dc.w    1        ; disk structure version
  57.         dc.w    DFLG_SWAPSIDES    ; flags (look below)
  58.         dc.l    TL_1a        ; list of tracks which contain data
  59.         dc.l    0        ; UNUSED, ALWAYS SET TO 0!
  60.         dc.l    FL_DISKIMAGE    ; list of files to be saved
  61.         dc.l    CRC_1        ; table of certain tracks with CRC values
  62.         dc.l    DSK_1b        ; alternative disk structure, if CRC failed
  63.         dc.l    0        ; called before a disk is read
  64.         dc.l    0        ; called after a disk has been read
  65.  
  66.  
  67. DSK_1b:        dc.l    0        ; pointer to next disk structure
  68.         dc.w    1        ; disk structure version
  69.         dc.w    DFLG_RAWREADONLY|DFLG_DOUBLEINC    ; flags (look below)
  70.         dc.l    TL_1b        ; list of tracks which contain data
  71.         dc.l    0        ; UNUSED, ALWAYS SET TO 0!
  72.         dc.l    FL_DISKIMAGE    ; list of files to be saved
  73.         dc.l    0        ; table of certain tracks with CRC values
  74.         dc.l    0        ; alternative disk structure, if CRC failed
  75.         dc.l    0        ; called before a disk is read
  76.         dc.l    0        ; called after a disk has been read
  77.  
  78. CRC_1:        CRCENTRY 1,$62b9
  79.         CRCEND
  80.  
  81. TL_1a:        TLENTRY    1,1,$1600,SYNC_STD,DMFM_STD
  82.         TLENTRY    2,75,$1770,SYNC_STD,DMFM_OutRun
  83.         TLENTRY    90,126,$1770,SYNC_STD,DMFM_OutRun    ; this is the main exe of outrun, length: $33780
  84.         TLEND
  85.  
  86. TL_1b:        TLENTRY    0,84,$1600,SYNC_STD,DMFM_STD
  87.         TLENTRY    86,118,$1600,SYNC_INDEX,DMFM_NULL    ; Errors on tracks 86,88,90. Tracks 92-118 are empty.
  88.         TLENTRY    120,158,$1600,SYNC_STD,DMFM_STD
  89.         TLENTRY    1,159,$1600,SYNC_STD,DMFM_STD
  90.         TLEND
  91.  
  92. DMFM_OutRun:
  93.         addq.l    #8,a0        ; $55555555,$aaaaaaaa
  94.  
  95.         move.l    #$55555555,d1
  96.         DECODE_L (a0)+,d1,d4
  97.  
  98.         move.w    #$1770/4-1,d2
  99.         moveq    #0,d3
  100. .l0        DECODE_L (a0)+,d1,d0
  101.         move.l    d0,(a1)+
  102.         sub.l    d0,d3
  103.         dbra    d2,.l0
  104.  
  105.         cmp.l    d3,d4
  106.         bne.b    .csum
  107.  
  108.         moveq    #IERR_OK,d0
  109.         rts
  110. .csum        moveq    #IERR_CHECKSUM,d0
  111.         rts
  112.